import java.util.Scanner;
import java.util.Stack;


public class Poland {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		   Scanner in = new Scanner(System.in);
			String[] RPN = in.nextLine().split(" ");
			//System.out.println(in.nextLine());
			System.out.println(new Poland().calculateRPN(RPN));
		}
		
		public double calculateRPN(String[] RPN) {
			assert (RPN != null && RPN.length != 0);
			Stack<Double> stack = new Stack<Double>();
			for (int i = 0; i < RPN.length; i++) {
				if (isNumber(RPN[i])) {
					try{
					stack.push(Double.parseDouble(RPN[i]));
					}catch(Exception e)
					{
						throw  new RuntimeException("RPNSyntaxErrorException");
					}
				} else {
					if(stack.size()<2)
							throw  new RuntimeException("RPNSyntaxErrorException");
						else
						{
							double v1 = stack.pop();
							double v2 = stack.pop();
							double result = eval(RPN[i], v2, v1);
							stack.push(result);
						}
				}
			}
			return stack.pop();
		}
		
		public boolean isNumber(String s) {
			if (s.equals("+") || s.equals("-") || s.equals("*") || s.equals("/")) return false;
			return true;
		}
		
		public static double eval(String op, double val1, double val2) {
	        if (op.equals("+")) return val1 + val2;
	        if (op.equals("-")) return val1 - val2;
	        if (op.equals("/")) 
	        	{
	        	if((val2>-0.000000000000000000001)&&(val2<0.000000000000000000001))
	        		 throw new RuntimeException("DevideByZeroException");
	        	else
	        	return val1 / val2;
	        	}
	        if (op.equals("*")) return val1 * val2;
	        throw new RuntimeException("RPNSyntaxErrorException");
	    }
}
